package vip.xiaomoli.nurse.model;

import java.lang.reflect.Field;

public class FieldWrapper {

    private Field field;

    private Object object;

    public FieldWrapper(Field field, Object object) {
        this.field = field;
        this.object = object;
    }

    public void setValue(Object value) {
        try {
            field.setAccessible(true);
            field.set(object, value);
            field.setAccessible(false);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

}
